home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 7
/
Apprentice-Release7.iso
/
Environments
/
Open Prolog 1.0.3d33
/
Samples
/
rooms
< prev
next >
Wrap
Text File
|
1993-10-06
|
246b
|
21 lines
door(a,b).
door(b,e).
door(b,c).
door(d,e).
door(c,d).
door(e,f).
door(g,e).
has_phone(g).
go(X,X,_,[]).
go(X,Y,T,[Z|R]):-
Y\==X,
(door(X,Z) ; door(Z,X)),
not member(Z,T),
go(Z,Y,[Z|T],R).
member(X,[X|_]).
member(X,[_|R]) :- member(X,R).